Skip to content

fix(eks_standard): break terraform locals cycle in cluster addons#348

Merged
unni-facets merged 1 commit into
mainfrom
fix/eks-standard-addons-cycle
May 28, 2026
Merged

fix(eks_standard): break terraform locals cycle in cluster addons#348
unni-facets merged 1 commit into
mainfrom
fix/eks-standard-addons-cycle

Conversation

@unni-facets

Copy link
Copy Markdown
Collaborator

Summary

  • terraform validate failed with Cycle: aws_iam_role.cloudwatch_agent_irsa → local.needs_cloudwatch_iam_policy → local.enabled_cluster_addons → local.cluster_addons_config → local.default_addons → aws_iam_role.cloudwatch_agent_irsa.
  • local.default_addons references aws_iam_role.cloudwatch_agent_irsa[0].arn, while the role's count depended on needs_cloudwatch_iam_policy, which was derived from enabled_cluster_addons (built from default_addons).
  • Source needs_cloudwatch_iam_policy directly from local.container_insights_enabled (spec input). That flag already gates inclusion of the amazon-cloudwatch-observability addon in default_addons, so semantics are unchanged.

Test plan

  • raptor create iac-module -f . --dry-run — terraform validate passes (security scan failures are pre-existing and out of scope)
  • Reviewer: confirm cloudwatch IRSA role still created iff container_insights_enabled = true

needs_cloudwatch_iam_policy was derived from enabled_cluster_addons,
which depends on default_addons, which references
aws_iam_role.cloudwatch_agent_irsa[0].arn. That role's count then
referenced needs_cloudwatch_iam_policy, closing the cycle.

Source needs_cloudwatch_iam_policy directly from container_insights_enabled
(spec input), which already gates inclusion of the cloudwatch addon.
@unni-facets
unni-facets merged commit 5cbb34d into main May 28, 2026
1 check passed
@unni-facets
unni-facets deleted the fix/eks-standard-addons-cycle branch May 28, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant